class CreateCentros < ActiveRecord::Migration
  def self.up
    create_table :centros do |t|
      t.column :nombre_comercial, :string, :null => false, :limit => 40
      t.column :razon_social, :string, :null => false, :limit => 40
      t.column :rfc, :string, :null => false, :limit => 15
      t.column :fecha_aniversario, :date, :null => true
      t.column :calle, :string, :null => false, :limit => 40
      t.column :num_exterior, :string, :null => false, :limit => 5
      t.column :num_interior, :string, :null => true, :limit => 5
      t.column :codigo_postal, :string, :null => false, :limit => 5
      t.column :colonia, :string, :null => false, :limit => 40
      t.column :ciudad, :string, :null => false, :limit => 40
      t.column :delegacion_municipio_id, :integer, :null => false
      t.column :estado_id, :integer, :null => false
      t.column :telefono_lada, :string, :limit => 4
      t.column :telefono_numero, :string, :limit => 10
      t.column :telefono_extension, :string, :limit => 5
      t.column :fax_lada, :string, :limit => 4
      t.column :fax_numero, :string, :limit => 10
      t.column :fax_extension, :string, :limit => 4
      t.column :tipo_cuenta_id, :integer, :null => false
      t.column :incentivos_tripulacion, :boolean, :default => true, :null => true
      t.column :incentivos_barra, :boolean, :default => true, :null => true
      t.column :giro_id, :integer, :null => false
      t.column :especialidad_id, :integer, :null => true
      t.column :rango_precio_id, :integer, :null => false
      t.column :calificacion_id, :integer, :null => false
      t.column :comentarios, :text, :null => true
      t.column :ejecutivo_id, :integer, :null => true
      t.column :status_id, :integer, :default => 0
    end
  end

  def self.down
    drop_table :centros
  end
end
